package com.example.javatwo.controller.cg.lmx;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.kafka.KafkaProperties.Producer;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.example.javatwo.pojo.cg.lmx.Product;
import com.example.javatwo.pojo.xs.zqy.PageBean;
import com.example.javatwo.service.cg.lmx.WuLiaoService;



@Controller
public class WuLiaoContr {
	@Autowired
	private WuLiaoService wlService;
	@RequestMapping("/wuliao")
	public String main() throws Exception {
		return "cg/lmx/wuliao";
	}
	@RequestMapping("/Product")
	@ResponseBody
	public List<Product> lodinSelectAll()throws Exception{
		System.out.println("jinru ");
		List<Product> p=wlService.loginSelectAll();
	
		return p;
	}
	@RequestMapping("/selectId")
	@ResponseBody
	public Product selectId(String id)throws Exception{
		return wlService.selectId(id);
	}
	@RequestMapping("/queryBuy1")
	@ResponseBody
	public PageBean QuerySupplierPage(int currentPage) throws Exception{
		Integer count = this.wlService.QuerySumCount();
		Object pageobj = this.wlService.QuerySupplierPage(currentPage);
		System.out.println(pageobj);
		PageBean bean = new PageBean(count,currentPage, pageobj);
		
		return bean;
	}
//	/**
//	 * 
//	 * @return
//	 * @throws Exception
//	 */
//	public String selectMaxId()throws Exception{
//		return null;
//		
//	}
}
